<template>
    <!-- 轮播图组件 -->
    <div class="swiper-container" ref="car">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="../../../public/images/img1.jpg" />
            </div>
            <div class="swiper-slide">
                <img src="../../../public/images/img2.jpg" />
            </div>
            <div class="swiper-slide">
                <img  src="../../../public/images/img3.jpg" />
            </div>
            <div class="swiper-slide">
                <img  src="../../../public/images/img4.jpg" />
            </div>
            <div class="swiper-slide">
                <img  src="../../../public/images/img5.jpg" />
            </div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>

        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
    </div>
</template>

<script>
import Swiper from 'swiper';
export default {
name:'Carousel',
mounted(){
    var mySwiper=new Swiper(this.$refs.car,{
        loop:true,
        pagination:{
            el:".swiper-pagination",
            clickable:true
        },
        navigation:{
            nextEl:".swiper-button-next",
            prevEl:".swiper-button-prev"
        }
    })
},
}
</script>

<style lang="css">
</style>